package com.villaday.idf.adapter;

import android.content.Context;
import android.graphics.Color;
import android.view.View;
import android.widget.TextView;

import com.villaday.idf.R;
import com.villaday.idf.base.AbsRecyclerViewAdapter;
import com.villaday.idf.base.OnAdapterCallbackListener;
import com.villaday.idf.model.HousesStates;
import com.villaday.idf.util.PhoneUtil;


public class DateCalendarInnerAdapter extends AbsRecyclerViewAdapter<HousesStates.BodyEntity.MonthsEntity.ListEntity> {
    private OnAdapterCallbackListener onAdapterCallbackListener;
    private View.OnClickListener onClickListener;
/*
    private final String roleType;
*/

    public DateCalendarInnerAdapter(Context context) {
        super(context, R.layout.item_calendar_inner, R.layout.item_page_loading,
                R.layout.item_page_bottom);

       /* RefreshtokenEntity.BodyBean roleInfo =
                SharedPreferencesUtil.getRoleInfo(context);
        roleType = roleInfo.getMember().getType();*/

    }


    @Override
    public void onBindHolder(AbsRecyclerViewAdapter.RecyclerViewHolder holder, HousesStates.BodyEntity.MonthsEntity.ListEntity d, int position) {
        if (d.getMyType() != 1) {
            holder.bindTextView(R.id.name, d.getDayOfMonth() + "")
                    .bindTextViewWithHtml(R.id.type, d.getStatus() == 1 ? "&yen;"+PhoneUtil.handleBalance((d.getCurrentPrice() / 100.0) + "", 0) : d.getStatusText() + "");
            TextView view = (TextView) holder.getView(R.id.name);
            if (d.getStatus()==4){
                view.setTextColor(Color.parseColor("#999999"));
            }else {
                view.setTextColor(Color.parseColor("#333333"));

            }


        }

    }

}
